package com.edevp.modules.user.fallback;

import com.edevp.common.core.dto.R;
import com.edevp.modules.user.dto.UserInfoDTO;
import com.edevp.modules.user.feign.UserFeignClient;
import lombok.Setter;
import org.springframework.stereotype.Component;

/**
 * @author lean
 */
//@Component
public class UserFeignFallback implements UserFeignClient {
    @Setter
    protected Throwable cause;

    @Override
    public R<UserInfoDTO> getUserInfo(String id) {
        UserInfoDTO userInfo = new UserInfoDTO();
        userInfo.setName("default");
        if(cause != null){
            cause.printStackTrace();
        }
        return R.ok(userInfo);
    }
}
